Skip to content

ci: bump flint to v0.8.0, switch to allow-list, add native lint tasks#1945

Merged
zeitlinger merged 3 commits intoprometheus:mainfrom
zeitlinger:flint-native-lint
Mar 18, 2026
Merged

ci: bump flint to v0.8.0, switch to allow-list, add native lint tasks#1945
zeitlinger merged 3 commits intoprometheus:mainfrom
zeitlinger:flint-native-lint

Conversation

@zeitlinger
Copy link
Member

Summary

  • Bump flint from v0.7.1 to v0.8.0
  • Switch super-linter.env from deny-list to allow-list format (only enables: bash, editorconfig, github-actions, git-merge-conflict-markers, json-prettier, markdown, markdown-prettier, renovate, shell-shfmt, spell-codespell, xml, yaml-prettier)
  • Add setup:native-lint-tools, pre-commit, and setup:pre-commit-hook mise tasks for local native linting

Test plan

  • CI passes with allow-list format
  • mise run lint:super-linter -- --native works locally

- Bump flint from v0.7.1 to v0.8.0
- Switch super-linter.env from deny-list to allow-list format
- Add setup:native-lint-tools, pre-commit, and setup:pre-commit-hook
  tasks for local native linting
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
run = "mise run lint:super-linter -- --native --autofix"
[tasks."setup:pre-commit-hook"]
description = "Install git pre-commit hook that runs native linting"
run = "mise generate git-pre-commit --write --task=pre-commit"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth adding these new commands to the readme?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea - added

Add a brief section pointing contributors to the new mise tasks
for installing native lint tools and the git pre-commit hook.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
zeitlinger added a commit to grafana/flint that referenced this pull request Mar 17, 2026
## Summary

- Native lint mode now fails when enabled linters are missing instead of
  silently skipping them with a warning
- Prints actionable message: `Run mise run setup:native-lint-tools to
install them`
- This prevents commits from passing the pre-commit hook when linters
can't
actually run (e.g. when `setup:native-lint-tools` failed due to a
missing
  version file)

## Context

Discovered via
[prometheus/client_java#1945](prometheus/client_java#1945)
where `CONTRIBUTING.md` had a 282-char line that passed the pre-commit
hook
because `editorconfig-checker` wasn't installed (the `v8.5.0.toml`
version
file was missing from flint, so `setup:native-lint-tools` couldn't
install
tools).

## Test plan

- [ ] Verify CI passes (shellcheck, super-linter)
- [ ] Test native mode with a missing tool — should now fail with
actionable
  message instead of a warning

---------

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Wrap pre-commit hook paragraph to stay under 100 chars per line.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger requested review from dhoard and fstab as code owners March 18, 2026 11:18
@zeitlinger zeitlinger merged commit 37c7806 into prometheus:main Mar 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants